export default {
  name: 'js-app',
  props: {
    id: [String, Number],
  },
  state() {
    return {
      modals: [],
    };
  },
  render() {
    const self = this;
    const props = self.props;
    const {
      id,
      style,
    } = props;

    const classes = `js-root`;

    return (
      <div ref="el" id={id || 'js-root'} style={style} className={classes}>
        <slot />
      </div>
    );
  },
  componentDidMount() {
    const self = this;
    const el = self.refs.el;
    const parentEl = el.parentNode;

    if (parentEl && parentEl !== document.body && parentEl.parentNode === document.body) {
      parentEl.style.height = '100%';
    }

  },
};
